@extends('admin/layout')
@section('title','会员管理')
@section('content')
<!-- Content Header (Page header) -->
<section class="content-header">
  <h1>
    <a href="{{asset('admin/manage')}}">管理员列表</a>
    <small>这是管理员更改页面</small>
  </h1>
  <ol class="breadcrumb">
  	<li><a href="{{asset('admin/index')}}"><i class="fa fa-th"></i> 管理首页</a></li>
    <li><i class="fa fa-users"></i> 管理员管理</li>
    <li><a href="{{asset('admin/manage')}}"><i class="fa fa-user"></i> 管理员列表</a></li>
    <li class="active">管理员更改</li>
  </ol>
</section>

<!-- Main content -->
<section class="content">
	<div class="row">
		<div class="col-md-12">
	  	  <!-- box start -->
          <div class="box box-info">
	        <div class="box-header with-border">
	          <h3 class="box-title"><i class="fa fa-user-plus">管理员更改</i></h3>
	        </div>
         <!--  @if(session('error'))
           {{session('error')}}
          @endif -->
          @if (count($errors) > 0)
              <div class="alert alert-danger">
                  <ol>
                      @foreach ($errors->all() as $error)
                          <li>{{ $error }}</li>
                      @endforeach
                  </ol>
              </div>
          @endif
            <!-- form start -->
            <form class="form-horizontal" action="/admin/manage/{{$data -> member_id}}" method="post" enctype="multipart/form-data">
              {{csrf_field()}}
              {{method_field("PUT")}}
              <input type="hidden" name="oldPic" value="{{$data -> pic}}">
              <div class="box-body">
                <div class="form-group">
                  <label for="inputname" class="col-sm-2 col-md-2 control-label">会员名称：</label>
                  <div class="col-sm-6 col-md-5">
                    <input type="text" name="name" value="{{$data -> name}}" disabled class="form-control" id="inputname" placeholder="请输入会员名称">
                  </div>
                  <span class="help-block col-sm-4 col-md-5">
                  </span>
                </div>
                <div class="form-group">
                  <label for="inputname" class="col-sm-2 col-md-2 control-label">会员昵称：</label>
                  <div class="col-sm-6 col-md-5">
                    <input type="text" name="nickname" value="{{$data -> nickname}}" class="form-control" id="inputname" placeholder="请输入会员昵称">
                  </div>
                  <span class="help-block col-sm-4 col-md-5">
                  </span>
                </div>
                @if($data -> permission != 3)
                <div class="form-group">
                  <label for="inputemail" class="col-sm-2 col-md-2 control-label">会员权限：</label>
                  <div class="col-sm-2 col-md-2">
                    @if($data -> permission == 3)
                      <select name="permission" class="form-control" >
                        <option  value="1">会员</option>
                        <option  value="{{$data -> permissionj}}" selected>管理员</option>
                      </select>
                    @else
                      <select name="permission" class="form-control" >
                        <option  value="1">会员</option>
                        <option  value="{{$data -> permission}}" selected>管理员</option>
                      </select>
                    @endif
                  </div>
                </div>
                @endif
                <div class="form-group">
                  <label for="inputpic" class="col-sm-2 col-md-2 control-label">个人头像：
                  </label>
                  <div class="col-sm-10 col-md-10">
                    <input type="file" name="pic" value="{{$data -> pic}}" class="" id="inputpic">
                    <img src="{{$data -> pic}}" width="200">
                  </div>
                  <span class="help-block col-sm-10 col-sm-offset-2 col-md-10 col-md-offset-2">
                  </span>
                </div>  

              <div class="box-footer">
                <button type="reset" class="btn btn-default col-sm-2 col-sm-offset-2 col-md-2 col-md-offset-2">清空</button>
                <button class="btn btn-info col-xs-offset-1 col-sm-2 col-sm-offset-1 col-md-2 col-md-offset-1">提交</button>
              </div>
            </form>
            <!-- /.form -->
          </div>
          <!-- /.box -->
	    </div>
    </div>
</section>
<!-- /.content -->
@stop